const express = require('express');
var logger = require('morgan');

const sysRouter = require('./src/routers/sys');
const userRouter = require('./src/routers/users');
const mysqlRouter = require('./src/routers/mysql');

const {jwtFilter} = require('./src/utils/jwtFilter');

const app = express();

app.use(logger('dev'));
app.use(jwtFilter);
app.use(sysRouter);
app.use(mysqlRouter);
app.use('/users',userRouter);

app.use((req,res,next)=>{
    res.status(404);
    res.send('404');
})


app.listen(3000,()=>{
    console.log('server run 3000.');
})